﻿using System;
using System.Linq;

namespace CardGamesLibrary.Cards.Decks
{
    public class FrenchDeck : Deck<FrenchDeckCard>
    {
        public FrenchDeck()
        {
        }

        protected override void InitAllCards()
        {
            Clear(); //clear the current cards

            var ranks = Enum.GetValues(typeof(Rank)).OfType<Rank>();
            var suites = Enum.GetValues(typeof(Suite)).OfType<Suite>();
            
            // init the 52 cards.
            foreach (var rank in ranks)
            {
                foreach (var suite in suites)
                {
                    Add(new FrenchDeckCard(rank, suite));
                }
            }
            Shuffle();
        }
    }
}